package com.ddwl.common.feign.wx;

import com.ddwl.schema.bo.gate.wechat.WxCodeBo;
import com.ddwl.schema.bo.gate.wechat.WxURLSchemeBo;
import com.ddwl.schema.vo.base.WxRestVo;
import com.ddwl.schema.vo.gate.wechat.WxSchemeVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author Fu Zhaohui
 * @version 1.0.0
 * @date 2021/6/2 17:26
 */
@Api(tags = "微信用户API")
@FeignClient(name = "WxWxaApi", path = "/wxa", url = "https://api.weixin.qq.com")
public interface WxWxaApi {

    @ApiOperation("用户支付完成后，获取该用户的 UnionId")
    @GetMapping("/getpaidunionid")
    WxRestVo getPaidUnionId(@RequestParam("access_token") String access_token,
                            @RequestParam("openid") String openid,
                            @RequestParam(value = "transaction_id", required = false) String transaction_id,
                            @RequestParam(value = "mch_id", required = false) String mch_id,
                            @RequestParam(value = "out_trade_no", required = false) String out_trade_no);


    @ApiOperation("获取URL scheme码")
    @PostMapping("/generatescheme")
    WxSchemeVo generateScheme(@RequestParam("access_token") String access_token, @RequestBody WxURLSchemeBo bo);

    @ApiOperation("获取小程序码")
    @PostMapping("/getwxacode")
    WxSchemeVo getWxaCode(@RequestParam("access_token") String access_token, @RequestBody WxCodeBo bo);


}
